home *** CD-ROM | disk | FTP | other *** search
- unit DMSQLIBX;
-
- interface
-
- uses
- Classes, DMSQLBase, IBQuery;
-
- type
- // An InterBase query that can change its where clause.
- TDMSQLIBQuery = class(TIBQuery, IDMSQLQuery)
- private
- FImplementor: TDMSQLQueryImpl;
- procedure AfterBuild(Sender: TDMSQLQueryImpl);
- procedure BeforeBuild(Sender: TDMSQLQueryImpl);
- procedure SetSQLText(Value: string);
- protected
- procedure Loaded; override;
- public
- constructor Create(AOwner: TComponent); override;
- published
- property Implementor: TDMSQLQueryImpl read FImplementor write FImplementor;
- end;
-
- implementation
-
- { TDMSQLIBQuery }
-
- constructor TDMSQLIBQuery.Create(AOwner: TComponent);
- begin
- inherited;
- FImplementor := TDMSQLQueryImpl.Create(Self);
- end;
-
- procedure TDMSQLIBQuery.BeforeBuild(Sender: TDMSQLQueryImpl);
- begin
- end;
-
- procedure TDMSQLIBQuery.AfterBuild(Sender: TDMSQLQueryImpl);
- begin
- if sqlOpenAfterBuild in Sender.SQLOptions then
- Open;
- end;
-
- procedure TDMSQLIBQuery.Loaded;
- begin
- inherited;
- FImplementor.BaseSQL := SQL;
- end;
-
- procedure TDMSQLIBQuery.SetSQLText(Value: string);
- begin
- SQL.Text := Value;
- end;
-
- end.
-